
layui.use(['layer', 'form', 'table', 'admin', 'ax', 'func','element',"index"], function () {
    var $ = layui.$;
    var layer = layui.layer;
    var form = layui.form;
    var table = layui.table;
    var element = layui.element;
    var $ax = layui.ax;
    var admin = layui.admin;
    var func = layui.func;
    var index =layui.index;


    // 表单提交事件
    form.on('submit(btnSubmit)', function (data) {
        var ajax = new $ax(Feng.ctxPath + "/flowModel/create", function (res) {
            Feng.success("添加成功！");
            //传给上个页面，刷新table用
            admin.putTempData('formOk', true);
            //关掉对话框
            admin.closeThisDialog();
            index.openTab({url:"/modeler/modeler.html?modelId=" + res.data,title: "模型在线设计"});
        }, function (data) {
            Feng.error("添加失败！" + data.responseJSON.message)
        });
        ajax.set(data.field);
        ajax.start();
        //添加 return false 可成功跳转页面
        return false;
    });








});
